import request from '@/config/axios'

// PI 巡查异常档案分类 VO
export interface ExceptionCategoryVO {
  id: number // 编号
  name: string // 名字
  parentId: number // 父级编号
  sort: number // 排序
}

// PI 巡查异常档案分类 API
export const ExceptionCategoryApi = {
  // 查询PI 巡查异常档案分类列表
  getExceptionCategoryList: async (params) => {
    return await request.get({ url: `/pi/exception-category/list`, params })
  },

  // 查询PI 巡查异常档案分类详情
  getExceptionCategory: async (id: number) => {
    return await request.get({ url: `/pi/exception-category/get?id=` + id })
  },

  // 新增PI 巡查异常档案分类
  createExceptionCategory: async (data: ExceptionCategoryVO) => {
    return await request.post({ url: `/pi/exception-category/create`, data })
  },

  // 修改PI 巡查异常档案分类
  updateExceptionCategory: async (data: ExceptionCategoryVO) => {
    return await request.put({ url: `/pi/exception-category/update`, data })
  },

  // 删除PI 巡查异常档案分类
  deleteExceptionCategory: async (id: number) => {
    return await request.delete({ url: `/pi/exception-category/delete?id=` + id })
  },

  // 导出PI 巡查异常档案分类 Excel
  exportExceptionCategory: async (params) => {
    return await request.download({ url: `/pi/exception-category/export-excel`, params })
  },
}